<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>压盖顺序</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div.box1{
            width: 400px;
            height: 400px;
            background: pink;
            float: left;
        }
        div.box2{
            width: 300px;
            height: 300px;
            background: skyblue;
            position: relative;
            left: 0;
            top: 0;
        }
        div.box3{
            width: 200px;
            height: 200px;
            background: orange;
            position: absolute;
            left: 0;
            top: 0;
        }
        div.box4{
            width: 100px;
            height: 100px;
            background: yellowgreen;
            position: fixed;
            left: 0;
            top: 0;
        }
    </style>
</head>
<body>
    <!-- 浮动，或者标准流 -->
    <div class="box1"></div>
    <!-- 相对定位 -->
    <div class="box2"></div>
    <!-- 决定定位 -->
    <div class="box3"></div>
    <!-- 固定定位 -->
    <div class="box4"></div>
</body>
</html>